import base from './base';
import axios from '../utils/Axios';

const albumapi = {
	getPhotosByAlbumId: (id) => {
		return new Promise((resolve, reject) => {
			axios
				.get(base.getPhotosByAlbumId , { params: { id } })
				.then((res) => {
					resolve(res.data);
				})
				.catch((error) => {
					reject(error.data);
				});
		});
	},

	uploadPhotos: (data) => {
		return new Promise((resolve, reject) => {
			axios
				.post(base.uploadPhotos, data)
				.then((res) => {
					resolve(res.data);
				})
				.catch((error) => {
					reject(error.data);
				});
		});
	},
	delPhotos: (data) => {
		return new Promise((resolve, reject) => {
			axios
				.post(base.delPhotos, data)
				.then((res) => {
					resolve(res.data);
				})
				.catch((error) => {
					reject(error.data);
				});
		});
	},

};

export default albumapi;
